﻿CREATE TABLE [dbo].[AngajatiSalarizare] (
    [IDAngajatSalarizare] INT             IDENTITY (1, 1) NOT NULL,
    [IdPersoana]          INT             NOT NULL,
    [DeLaData]            DATETIME        CONSTRAINT [DF_AngajatiSalarizare_DeLaData] DEFAULT (getdate()) NOT NULL,
    [Salar]               INT             NOT NULL,
    [IDDepartament]       INT             NOT NULL,
    [IdTipGrad]           INT             CONSTRAINT [DF_AngajatiSalarizare_IdTipGrad] DEFAULT ((0)) NOT NULL,
    [OreNorma]            SMALLINT        CONSTRAINT [DF_AngajatiSalarizare_OreNorma] DEFAULT ((0)) NOT NULL,
    [FractiuneNorma]      DECIMAL (5, 2)  CONSTRAINT [DF_AngajatiSalarizare_FractiuneNorma] DEFAULT ((1)) NOT NULL,
    [PanaLaData]          DATETIME        NULL,
    [NormaBaza]           BIT             CONSTRAINT [DF_AngajatiSalarizare_NormaBaza] DEFAULT ((0)) NOT NULL,
    [ServiciiPeChitanta]  BIT             NULL,
    [CodUnitate]          SMALLINT        DEFAULT ((0)) NOT NULL,
    [Clasa]               SMALLINT        DEFAULT ((0)) NOT NULL,
    [Grupa]               VARCHAR (20)    NULL,
    [IDJurnal]            INT             NULL,
    [SalarFunctie]        DECIMAL (18, 2) DEFAULT ((0)) NOT NULL,
    [Marca]               INT             NULL,
    [NrContract]          VARCHAR (20)    NULL,
    [DataContract]        DATETIME        NULL,
    [TipContract]         INT             NULL,
    [PerioadaDeterminata] BIT             NULL,
    [Observatii]          VARCHAR (250)   NULL,
    [DurataContract]      FLOAT (53)      NULL,
    [VechimeSporAni]      SMALLINT        DEFAULT ((0)) NOT NULL,
    [VechimeSporLuni]     DECIMAL (6, 3)  DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_EMPLOYEES_1__100] PRIMARY KEY CLUSTERED ([IDAngajatSalarizare] ASC) WITH (FILLFACTOR = 90),
    CONSTRAINT [FK_ANGAJATISalarizare_DEPARTAMENTE] FOREIGN KEY ([IDDepartament]) REFERENCES [dbo].[Departamente] ([IDDepartament]) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT [FK_AngajatiSalarizare_Jurnale] FOREIGN KEY ([IDJurnal]) REFERENCES [dbo].[Jurnale] ([IDJurnal]),
    CONSTRAINT [FK_AngajatiSalarizare_Persoane] FOREIGN KEY ([IdPersoana]) REFERENCES [dbo].[Persoane] ([IdPersoana]),
    CONSTRAINT [FK_AngajatiSalarizare_TipContracte] FOREIGN KEY ([TipContract]) REFERENCES [dbo].[TipContracte] ([TipContract]),
    CONSTRAINT [FK_AngajatiSalarizare_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

